load("@rules_cc//cc:defs.bzl", "cc_binary", "cc_library")
load("//tools:apollo.bzl", "cyber_plugin_description")
load("//tools:apollo_package.bzl", "apollo_cc_library", "apollo_package", "apollo_plugin")
load("//tools/proto:proto.bzl", "proto_library")
load("//tools:cpplint.bzl", "cpplint")

package(default_visibility = ["//visibility:public"])

filegroup(
    name = "left_turn_waiting_zone_files",
    srcs = glob([
        "conf/**",
    ]),
)

apollo_plugin(
    name = "libtraffic_light_left_turn_waiting_zone.so",
    srcs = [
        "stage_approach.cc",
        "stage_creep.cc",
        "stage_intersection_cruise.cc",
        "traffic_light_left_turn_waiting_zone.cc",
    ],
    hdrs = [
        "stage_approach.h",
        "stage_creep.h",
        "stage_intersection_cruise.h",
        "traffic_light_left_turn_waiting_zone.h",
    ],
    copts = ["-DMODULE_NAME=\\\"planning\\\""],
    description = ":plugins.xml",
    deps = [
        # ✅ 1. 原有依赖（保留）
        "//cyber",
        "//modules/common/util:common_util",
        "//modules/common/util:util_tool",
        "//modules/common_msgs/planning_msgs:planning_cc_proto",
        "//modules/map:apollo_map",
        "//modules/planning/planning_base:apollo_planning_planning_base",
        "//modules/planning/scenarios/traffic_light_left_turn_waiting_zone/proto:traffic_light_left_turn_waiting_zone_cc_proto",

        # 使用已存在的接口基类聚合库，而不是引用不存在的子包
        "//modules/planning/planning_interface_base:apollo_planning_planning_interface_base",
        # 仅保留实际存在的proto依赖
        "//modules/planning/planning_interface_base/scenario_base/proto:scenario_pipeline_proto",
    ],
)

apollo_package()

cpplint()